<template>
  <div class="app-container home" style="background: #f0f2f5">
    <div class="contentBox">
      <el-row :gutter="20">
        <el-col :sm="24" :md="2">
          <img :src="avatar" class="logoUser" />
        </el-col>
        <el-col :sm="24" :md="15">
          <h1 class="name">
            早安, {{ $store.state.user.nickName }}, 开始您一天的工作吧！
          </h1>
        </el-col>
        <el-col
          style="text-align: right; line-height: 30px; cursor: pointer"
          :sm="24"
          :md="6"
          @click.native="getWork"
        >
          <div style="color: #000">待办</div>
          <div style="font-size: 24px; color: #000">{{ countFlow }}</div>
        </el-col>
        <!-- <el-col :sm="24" :md="2"> 头像 </el-col> -->
      </el-row>
    </div>
    <el-row :gutter="20">
      <el-col :sm="24" :md="18">
        <el-row :gutter="20">
          <el-col :sm="24" :md="12">
            <leftOne></leftOne>
          </el-col>
          <el-col :sm="24" :md="12">
            <leftSecond></leftSecond>
          </el-col>
        </el-row>
        <el-card style="margin-top: 20px">
          <div slot="header" class="clearfix">
            <span class="title">趋势图</span>
          </div>
          <leftChart></leftChart>
        </el-card>
      </el-col>
      <el-col :sm="24" :md="6">
        <rightCalendar></rightCalendar>
        <rightContent></rightContent>
      </el-col>
    </el-row>
    <el-card style="margin-top: 20px">
      <div slot="header" class="clearfix">
        <span class="title">重点项目计划</span>
      </div>
      <el-table :data="tableList">
        <el-table-column prop="name" label="项目名称"></el-table-column>
        <el-table-column prop="jj" label="项目简介"></el-table-column>
        <el-table-column label="进度比例" align="center" prop="createTime">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.createTime) }}</span>
          </template>
        </el-table-column>
        <el-table-column
          prop="jdqk"
          label="进度情况"
          :show-overflow-tooltip="true"
        ></el-table-column>
        <el-table-column prop="jdqk" label="负责人"></el-table-column>
        <el-table-column prop="jdqk" label="现场负责人"></el-table-column>
        <el-table-column prop="jdqk" label="项目计划工期"></el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script>
import { mapGetters } from "vuex";

import leftOne from "./components/index/left_one.vue";
import leftSecond from "./components/index/left_second.vue";
import leftChart from "./components/index/left_chart.vue";
import rightContent from "./components/index/right_second.vue";
import rightCalendar from "./components/index/right_calendar.vue";

import { todoCount } from "@/api/workflow/process.js";
export default {
  name: "Index",
  components: {
    leftOne,
    leftSecond,
    leftChart,
    rightContent,
    rightCalendar,
  },
  data() {
    return {
      // 版本号
      version: "0.8.0",
      tableList: [
        {
          name: "苏州项目",
          jj: "简介",
          jdqk: "进度",
        },
      ],
    };
  },
  computed: {
    ...mapGetters(["sidebar", "avatar", "device", "countFlow"]),
  },
  mounted() {},
  methods: {
    goTarget(href) {
      window.open(href, "_blank");
    },
    getWork() {
      this.$router.push("/work/todo");
    },
  },
};
</script>

<style scoped lang="scss">
.home {
  blockquote {
    padding: 10px 20px;
    margin: 0 0 20px;
    font-size: 17.5px;
    border-left: 5px solid #eee;
  }
  hr {
    margin-top: 20px;
    margin-bottom: 20px;
    border: 0;
    border-top: 1px solid #eee;
  }
  .col-item {
    margin-bottom: 20px;
  }

  ul {
    padding: 0;
    margin: 0;
  }

  font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px;
  color: #676a6c;
  overflow-x: hidden;

  ul {
    list-style-type: none;
  }

  h4 {
    margin-top: 0px;
  }

  h2 {
    margin-top: 10px;
    font-size: 26px;
    font-weight: 100;
  }

  p {
    margin-top: 10px;

    b {
      font-weight: 700;
    }
  }

  .update-log {
    ol {
      display: block;
      list-style-type: decimal;
      margin-block-start: 1em;
      margin-block-end: 1em;
      margin-inline-start: 0;
      margin-inline-end: 0;
      padding-inline-start: 40px;
    }
  }
}
.contentBox {
  margin-bottom: 20px;
  background: white;
  padding: 16px 24px;
  .logoUser {
    width: 70px;
    height: 70px;
    border-radius: 50%;
  }
  .name {
    line-height: 35px;
    color: #000;
  }
}
</style>
